﻿#include <iostream>

using namespace std;

int main()
{
    int array_size;
    cin >> array_size;
    int i = 1;
    int number, sum, greatest, least;
    cin >> number;
    sum = greatest = least = number;
    while (i != array_size)
    {
        cin >> number;
        sum += number;
        greatest = greatest > number ? greatest : number;
        least = least < number ? least : number;
        i++;
    }
    cout << sum << ' ' << least << ' ' << greatest;
    return 0;
}